package omm.domain.enums;

public enum GroupBy {

	PRODUCT(1), ENTITY(2);
	private int code;

	GroupBy(int code) {
		this.code = code;
	}

	int getCode() {
		return code;
	}

	public static GroupBy fromCode(Integer code) {
		if (code != null) {
			for (GroupBy b : GroupBy.values()) {
				if (code == b.getCode()) {
					return b;
				}
			}
		}
		return null;
	}
}
